import axios from 'axios'
import http from '../../units/http'


//登录
// getLoginStatus
export function getLoginStatus(data){
  return http.post("/admin/login",data)
}
export function getLoginOut(data){
  return http.get("/admin/logout",data)
}
//突出登录
//查询所有管理员
export function getUserList(data){
  return http.post("/admin/list",data)
}
//添加管理员

export function addUser(data){
  return http.post("/admin/add",data)
}
//编辑管理员

export function updateUser(data){
  return http.post("/admin/update",data)
}
//删除管理员
export function delUser(data){
  return http.get("/admin/delete/"+data)
}
//查询待收总金额，逾期总金额
export function getAllAmount(data){
  return http.get("/admin/order_stage/query_amount",data)
}
//修改密码updatePwdc
export function updatePwd(data){
  return http.post("/admin/updatePwd",data)
}
//课程列表
export function getCourseList(data){
  return http.post("/admin/course/list",data)
}

//添加课程addCourse
export function addCourse(data){
  return http.post("/admin/course/add",data)
}
//判断课程是否已存在
export function getByName(data){
  return http.get("/admin/course/getByName/"+data)
}
//修改课程
export function updateCourse(data){
  return http.post("/admin/course/update",data)
}
//删除课程
export function delCourse(data){
  return http.get("/admin/course/delete/"+data)
}
//查询所有订单
export function getAllOrder(data){
  return http.post("/admin/order/list",data)
}
//
export function getOrderById(data){
  return http.get("/admin/order/query/"+data)
}
//删订单delOrder
export function delOrder(data){
  return http.get("/admin/order/delete/"+data)
}
//修改订单状态通过id
//
export function updateAuditById(data){
  return http.post("/admin/order/update",data)
}

//拿得到分期订单

export function getOrderStage(data){
  return http.get("/admin/order_stage/query/"+data)
}

//分期订单均摊
export function affirmAvg(data){
  return http.post("/admin/order_stage/count_delay_amount",data)
}
//延期
export function affirmOneMonth(data){
  return http.post("/admin/order_stage/add_delay_order_stage",data)
}
//关闭订单 closeOrderVisible
export function affirmCloseOrder(data){
  return http.post("/admin/order_stage/update",data)
}

//方案
//查询方案
export function getPlanList(data){
  return http.post("/admin/plan/list",data)
}

//添加方案

export function addPlan(data){
  return http.post("/admin/plan/add",data)
}
//修改方案
export function updatePlan(data){
  return http.post("/admin/plan/update",data)
}
//删除方案

export function delPlan(data){
  return http.get("/admin/plan/delete/"+data)
}
//逾期订单
export function overdueList(data){
  return http.post("/admin/order_stage/query_delay_order_stage",data)
}

//拿到图片路径/user/idCardOCR/upload
export function uploadImg(data){
  return http.post("/admin/user/idCardOCR/upload",data)
}
//上传图片idCardOCR
export function idCardOCR(data){
  return http.post("/admin/user/idCardOCR/identify",data)
}


//查询所有用户
export function get_UserList(data){
  return http.post("/admin/dou/list",data)
}

// 查询一个用户信息
// admin/dou/getoneuser/id
export function get_UserDetail(id){
  return http.get(`/admin/dou/getoneuser/${id}`)
}

// 省份证到期时间
export function get_UserInformDate(id){
  return http.get(`/admin/dou/date/${id}`)
}

// 下载表单
export function get_downInformDate(data){
  // return http.post("/admin/order/download",data,'blob')
  return axios({
    url:'api/admin/order/download',
    method: 'post',
    data:data,
    responseType: 'blob',
  })
}


//updateSet
//系统配置

export function updateSet(data){
  return http.post("/admin/set/get",data)
}
export function getSet(data){
  return http.post("/admin/set/update",data)
}

